package com.example.xpvideo.exception;

import com.example.xpvideo.enums.ErrCodeEnum;

/**
 * @author : 洪俊新
 * @date : 2021/1/8 12:17
 * @description:
 */
public class ErrorException extends Exception {

    private Integer code;
    private String apiMessage;
    public ErrorException(ErrCodeEnum errCodeEnum) {
        super(errCodeEnum.getMessage());
        this.code = errCodeEnum.getCode();
    }
    public ErrorException(ErrCodeEnum errCodeEnum, String apiMessage) {
        super(apiMessage);
        this.code = errCodeEnum.getCode();
        this.apiMessage=apiMessage;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getApiMessage() {
        return apiMessage;
    }

    public void setApiMessage(String apiMessage) {
        this.apiMessage = apiMessage;
    }
}
